package com.example.demojpa.controller;

import com.example.demojpa.config.AjaxResult;
import com.example.demojpa.dao.HobbyDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("hobby")
@RestController
@CrossOrigin
public class HobbyController {

    @Autowired
    private HobbyDao hobbyDao;

    @RequestMapping("getList")
    public AjaxResult getList(){
        return AjaxResult.ok(hobbyDao.findAll());
    }
}
